package com.bfxy.collector.web;

import com.bfxy.collector.util.InputMDC;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @describte:TODO
 * @program:foodie-dev
 * @author:zhengdp
 * @create:2021-09-18 18:15:46
 **/
@Slf4j
@RestController
public class IndexController {


    @RequestMapping(value = "/index")
    public String index(){
        InputMDC.putMDC();
        // 日志输出
        log.info("this is info level log");
        log.warn("this is warn level log");
        log.error("this is error level log");
        return "idx";
    }

    @RequestMapping(value = "/err")
    public String err(){
        InputMDC.putMDC();
        try{
            int a  = 1/0;
        }catch (Exception e){
            log.error("算数异常",e);
        }
        return "xx";
    }
}
